//-----------------------------------------------------------------------------
// <copyright file="UnbufferedBatchGeneratedClient.cs" company=".NET Foundation">
//      Copyright (c) .NET Foundation and Contributors. All rights reserved. 
//      See License.txt in the project root for license information.
// </copyright>
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34011
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generation date: 4/9/2014 5:50:55 AM
namespace Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy
{
    /// <summary>
    /// There are no comments for Container in the schema.
    /// </summary>
    public partial class Container : global::Microsoft.OData.Client.DataServiceContext
    {
        /// <summary>
        /// Initialize a new Container object.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public Container(global::System.Uri serviceRoot) :
            base(serviceRoot, global::Microsoft.OData.Client.ODataProtocolVersion.V4)
        {
            this.ResolveName = new global::System.Func<global::System.Type, string>(this.ResolveNameFromType);
            this.ResolveType = new global::System.Func<string, global::System.Type>(this.ResolveTypeFromName);
            this.OnContextCreated();
            this.Format.LoadServiceModel = GeneratedEdmModel.GetInstance;
            this.Format.UseJson();
        }
        partial void OnContextCreated();
        /// <summary>
        /// Since the namespace configured for this service reference
        /// in Visual Studio is different from the one indicated in the
        /// server schema, use type-mappers to map between the two.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        protected global::System.Type ResolveTypeFromName(string typeName)
        {
            global::System.Type resolvedType = this.DefaultResolveType(typeName, "Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient", "Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy");
            if ((resolvedType != null))
            {
                return resolvedType;
            }
            return null;
        }
        /// <summary>
        /// Since the namespace configured for this service reference
        /// in Visual Studio is different from the one indicated in the
        /// server schema, use type-mappers to map between the two.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        protected string ResolveNameFromType(global::System.Type clientType)
        {
            if (clientType.Namespace.Equals("Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy", global::System.StringComparison.Ordinal))
            {
                return string.Concat("Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.", clientType.Name);
            }
            return null;
        }
        /// <summary>
        /// There are no comments for UnbufferedBatchCustomer in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<UnbufferedBatchCustomer> UnbufferedBatchCustomer
        {
            get
            {
                if ((this._UnbufferedBatchCustomer == null))
                {
                    this._UnbufferedBatchCustomer = base.CreateQuery<UnbufferedBatchCustomer>("UnbufferedBatchCustomer");
                }
                return this._UnbufferedBatchCustomer;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<UnbufferedBatchCustomer> _UnbufferedBatchCustomer;
        /// <summary>
        /// There are no comments for UnbufferedBatchOrder in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public global::Microsoft.OData.Client.DataServiceQuery<UnbufferedBatchOrder> UnbufferedBatchOrder
        {
            get
            {
                if ((this._UnbufferedBatchOrder == null))
                {
                    this._UnbufferedBatchOrder = base.CreateQuery<UnbufferedBatchOrder>("UnbufferedBatchOrder");
                }
                return this._UnbufferedBatchOrder;
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private global::Microsoft.OData.Client.DataServiceQuery<UnbufferedBatchOrder> _UnbufferedBatchOrder;
        /// <summary>
        /// There are no comments for UnbufferedBatchCustomer in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public void AddToUnbufferedBatchCustomer(UnbufferedBatchCustomer unbufferedBatchCustomer)
        {
            base.AddObject("UnbufferedBatchCustomer", unbufferedBatchCustomer);
        }
        /// <summary>
        /// There are no comments for UnbufferedBatchOrder in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public void AddToUnbufferedBatchOrder(UnbufferedBatchOrder unbufferedBatchOrder)
        {
            base.AddObject("UnbufferedBatchOrder", unbufferedBatchOrder);
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private abstract class GeneratedEdmModel
        {
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
            private static global::Microsoft.OData.Edm.IEdmModel ParsedModel = LoadModelFromString();
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
            private const string Edmx = @"<edmx:Edmx Version=""4.0"" xmlns:edmx=""http://docs.oasis-open.org/odata/ns/edmx"">
  <edmx:DataServices>
    <Schema Namespace=""Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
      <EntityType Name=""UnbufferedBatchCustomer"">
        <Key>
          <PropertyRef Name=""Id"" />
        </Key>
        <Property Name=""Id"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""Name"" Type=""Edm.String"" />
        <NavigationProperty Name=""Orders"" Type=""Collection(Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.UnbufferedBatchOrder)"" />
      </EntityType>
      <EntityType Name=""UnbufferedBatchOrder"">
        <Key>
          <PropertyRef Name=""Id"" />
        </Key>
        <Property Name=""Id"" Type=""Edm.Int32"" Nullable=""false"" />
        <Property Name=""PurchaseDate"" Type=""Edm.DateTimeOffset"" Nullable=""false"" />
      </EntityType>
      <Action Name=""OddCustomers"" IsBound=""true"">
        <Parameter Name=""bindingParameter"" Type=""Collection(Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.UnbufferedBatchCustomer)"" />
        <ReturnType Type=""Collection(Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.UnbufferedBatchCustomer)"" />
      </Action>
      <EntityContainer Name=""Container"">
        <EntitySet Name=""UnbufferedBatchCustomer"" EntityType=""Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.UnbufferedBatchCustomer"">
          <NavigationPropertyBinding Path=""Orders"" Target=""UnbufferedBatchOrder"" />
        </EntitySet>
        <EntitySet Name=""UnbufferedBatchOrder"" EntityType=""Microsoft.Test.E2E.AspNet.OData.Batch.Tests.DataServicesClient.UnbufferedBatchOrder"" />
      </EntityContainer>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>";
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
            public static global::Microsoft.OData.Edm.IEdmModel GetInstance()
            {
                return ParsedModel;
            }
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
            private static global::Microsoft.OData.Edm.IEdmModel LoadModelFromString()
            {
                global::System.Xml.XmlReader reader = CreateXmlReader(Edmx);
                try
                {
                    return global::Microsoft.OData.Edm.Csdl.CsdlReader.Parse(reader);
                }
                finally
                {
                    ((global::System.IDisposable)(reader)).Dispose();
                }
            }
            [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
            private static global::System.Xml.XmlReader CreateXmlReader(string edmxToParse)
            {
                return global::System.Xml.XmlReader.Create(new global::System.IO.StringReader(edmxToParse));
            }
        }
    }
    /// <summary>
    /// There are no comments for UnbufferedBatchCustomer in the schema.
    /// </summary>
    /// <KeyProperties>
    /// Id
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("Id")]
    public partial class UnbufferedBatchCustomer
    {
        /// <summary>
        /// Create a new UnbufferedBatchCustomer object.
        /// </summary>
        /// <param name="ID">Initial value of Id.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public static UnbufferedBatchCustomer CreateUnbufferedBatchCustomer(int ID)
        {
            UnbufferedBatchCustomer unbufferedBatchCustomer = new UnbufferedBatchCustomer();
            unbufferedBatchCustomer.Id = ID;
            return unbufferedBatchCustomer;
        }
        /// <summary>
        /// There are no comments for Property Id in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this.OnIdChanging(value);
                this._Id = value;
                this.OnIdChanged();
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private int _Id;
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this._Name = value;
                this.OnNameChanged();
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Orders in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public global::System.Collections.ObjectModel.Collection<global::Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy.UnbufferedBatchOrder> Orders
        {
            get
            {
                return this._Orders;
            }
            set
            {
                this.OnOrdersChanging(value);
                this._Orders = value;
                this.OnOrdersChanged();
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private global::System.Collections.ObjectModel.Collection<global::Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy.UnbufferedBatchOrder> _Orders = new global::System.Collections.ObjectModel.Collection<global::Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy.UnbufferedBatchOrder>();
        partial void OnOrdersChanging(global::System.Collections.ObjectModel.Collection<global::Microsoft.Test.E2E.AspNet.OData.Batch.Tests.UnbufferedBatchProxy.UnbufferedBatchOrder> value);
        partial void OnOrdersChanged();
    }
    /// <summary>
    /// There are no comments for UnbufferedBatchOrder in the schema.
    /// </summary>
    /// <KeyProperties>
    /// Id
    /// </KeyProperties>
    [global::Microsoft.OData.Client.Key("Id")]
    public partial class UnbufferedBatchOrder
    {
        /// <summary>
        /// Create a new UnbufferedBatchOrder object.
        /// </summary>
        /// <param name="ID">Initial value of Id.</param>
        /// <param name="purchaseDate">Initial value of PurchaseDate.</param>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public static UnbufferedBatchOrder CreateUnbufferedBatchOrder(int ID, global::System.DateTimeOffset purchaseDate)
        {
            UnbufferedBatchOrder unbufferedBatchOrder = new UnbufferedBatchOrder();
            unbufferedBatchOrder.Id = ID;
            unbufferedBatchOrder.PurchaseDate = purchaseDate;
            return unbufferedBatchOrder;
        }
        /// <summary>
        /// There are no comments for Property Id in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                this.OnIdChanging(value);
                this._Id = value;
                this.OnIdChanged();
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private int _Id;
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        /// <summary>
        /// There are no comments for Property PurchaseDate in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        public global::System.DateTimeOffset PurchaseDate
        {
            get
            {
                return this._PurchaseDate;
            }
            set
            {
                this.OnPurchaseDateChanging(value);
                this._PurchaseDate = value;
                this.OnPurchaseDateChanged();
            }
        }
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "1.0.0")]
        private global::System.DateTimeOffset _PurchaseDate;
        partial void OnPurchaseDateChanging(global::System.DateTimeOffset value);
        partial void OnPurchaseDateChanged();
    }
}
